<!DOCTYPE html>
<html lang="zh_CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>宫位 | 紫微研习社 ziwei.pro</title>
    <meta name="description" content="紫微研习社，iztro官方文档，iztro开发文档，iztro紫微斗数宫位介绍，iztro的palace对象使用方法以及示例代码。">
    <link rel="preload stylesheet" href="/assets/style.1799bce1.css" as="style">
    
    <script type="module" src="/assets/app.f274ddab.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/assets/chunks/framework.589369be.js">
    <link rel="modulepreload" href="/assets/chunks/theme.6c1f3628.js">
    <link rel="modulepreload" href="/assets/posts_palace.md.269d024b.lean.js">
    <meta keyword="紫微研习社,紫微斗数,ziweidoushu,iztro,紫微斗数排盘,紫微斗数学习,紫微斗数入门">
    <meta author="SylarLong">
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-WR6P6S20P2"></script>
    <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-WR6P6S20P2");</script>
    <script>var _hmt=_hmt||[];(function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?e6306139059dd0191562066be8272318";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();</script>
    <meta name="baidu-site-verification" content="codeva-f4WginZgsF">
    <meta name="msvalidate.01" content="12373B57E08DD59CE573232894C0822B">
    <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
    <link rel="icon" sizes="32x32" type="image/png" href="/static/favicon-32x32.png">
    <link rel="icon" sizes="16x16" type="image/png" href="/static/favicon-16x16.png">
    <link rel="manifest" href="/static/site.webmanifest">
    <link rel="icon" type="image/svg+xml" href="/static/favicon.ico">
    <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-324e8308><!--[--><!--]--><!--[--><span tabindex="-1" data-v-9c8615dd></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-9c8615dd> Skip to content </a><!--]--><!----><header class="VPNav" data-v-324e8308 data-v-5bdc5df3><div class="VPNavBar has-sidebar" data-v-5bdc5df3 data-v-c8ceaf10><div class="container" data-v-c8ceaf10><div class="title" data-v-c8ceaf10><div class="VPNavBarTitle has-sidebar" data-v-c8ceaf10 data-v-2973dbb4><a class="title" href="/" data-v-2973dbb4><!--[--><!--]--><!----><!--[-->紫微研习社 ziwei.pro<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-c8ceaf10><div class="curtain" data-v-c8ceaf10></div><div class="content-body" data-v-c8ceaf10><!--[--><!--]--><div class="VPNavBarSearch search" style="--vp-meta-key:&#39;Meta&#39;;" data-v-c8ceaf10><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg class="DocSearch-Search-Icon" width="20" height="20" viewBox="0 0 20 20" aria-label="search icon"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-c8ceaf10 data-v-f732b5d0><span id="main-nav-aria-label" class="visually-hidden" data-v-f732b5d0>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>主页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/quick-start.html" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>开发</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/learn/basis.html" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>新手村</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://ziwei.pub" target="_blank" rel="noreferrer" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>排盘</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/SylarLong/iztro/discussions" target="_blank" rel="noreferrer" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>讨论</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/about.html" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091>关于作者</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/SylarLong/iztro" target="_blank" rel="noreferrer" tabindex="0" data-v-f732b5d0 data-v-e5ab8091><!--[--><span data-v-e5ab8091><img src="https://img.shields.io/github/stars/sylarlong/iztro.svg?style=social&label=Star" alt="iztro" /></span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-f732b5d0 data-v-6b19ffdd><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-6b19ffdd><span class="text" data-v-6b19ffdd><!----><span data-v-6b19ffdd>v2.4.1</span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-6b19ffdd><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-6b19ffdd><div class="VPMenu" data-v-6b19ffdd data-v-e42ed9b3><div class="items" data-v-e42ed9b3><!--[--><!--[--><div class="VPMenuLink" data-v-e42ed9b3 data-v-2a4d50e5><a class="VPLink link vp-external-link-icon" href="https://github.com/SylarLong/iztro/blob/main/CHANGELOG.md" target="_blank" rel="noreferrer" data-v-2a4d50e5><!--[-->更改日志<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-e42ed9b3 data-v-2a4d50e5><a class="VPLink link vp-external-link-icon" href="https://www.npmjs.com/package/iztro" target="_blank" rel="noreferrer" data-v-2a4d50e5><!--[-->NPM地址<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-c8ceaf10 data-v-ff4524ae data-v-6b19ffdd><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-6b19ffdd><span class="text" data-v-6b19ffdd><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="option-icon" data-v-6b19ffdd><path d="M0 0h24v24H0z" fill="none"></path><path d=" M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z " class="css-c4d79v"></path></svg><!----><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-6b19ffdd><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-6b19ffdd><div class="VPMenu" data-v-6b19ffdd data-v-e42ed9b3><!----><!--[--><!--[--><div class="items" data-v-ff4524ae><p class="title" data-v-ff4524ae>简体中文</p><!--[--><div class="VPMenuLink" data-v-ff4524ae data-v-2a4d50e5><a class="VPLink link" href="/zh_TW/posts/palace.html" data-v-2a4d50e5><!--[-->繁體中文<!--]--></a></div><div class="VPMenuLink" data-v-ff4524ae data-v-2a4d50e5><a class="VPLink link" href="/en_US/posts/palace.html" data-v-2a4d50e5><!--[-->English<!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-c8ceaf10 data-v-5e9f0637><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-5e9f0637 data-v-a99ed743 data-v-92d8f6fb><span class="check" data-v-92d8f6fb><span class="icon" data-v-92d8f6fb><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-a99ed743><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-a99ed743><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-c8ceaf10 data-v-ef6192dc data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/SylarLong/iztro" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-16cf740a><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-c8ceaf10 data-v-c8c2ae4b data-v-6b19ffdd><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-6b19ffdd><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-6b19ffdd><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-6b19ffdd><div class="VPMenu" data-v-6b19ffdd data-v-e42ed9b3><!----><!--[--><!--[--><div class="group translations" data-v-c8c2ae4b><p class="trans-title" data-v-c8c2ae4b>简体中文</p><!--[--><div class="VPMenuLink" data-v-c8c2ae4b data-v-2a4d50e5><a class="VPLink link" href="/zh_TW/posts/palace.html" data-v-2a4d50e5><!--[-->繁體中文<!--]--></a></div><div class="VPMenuLink" data-v-c8c2ae4b data-v-2a4d50e5><a class="VPLink link" href="/en_US/posts/palace.html" data-v-2a4d50e5><!--[-->English<!--]--></a></div><!--]--></div><div class="group" data-v-c8c2ae4b><div class="item appearance" data-v-c8c2ae4b><p class="label" data-v-c8c2ae4b>Appearance</p><div class="appearance-action" data-v-c8c2ae4b><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-c8c2ae4b data-v-a99ed743 data-v-92d8f6fb><span class="check" data-v-92d8f6fb><span class="icon" data-v-92d8f6fb><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-a99ed743><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-a99ed743><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><div class="group" data-v-c8c2ae4b><div class="item social-links" data-v-c8c2ae4b><div class="VPSocialLinks social-links-list" data-v-c8c2ae4b data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/SylarLong/iztro" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-16cf740a><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-c8ceaf10 data-v-6bee1efd><span class="container" data-v-6bee1efd><span class="top" data-v-6bee1efd></span><span class="middle" data-v-6bee1efd></span><span class="bottom" data-v-6bee1efd></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav reached-top" data-v-324e8308 data-v-693d654a><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-693d654a><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-693d654a><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-693d654a>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-693d654a data-v-e8ae7d87><button data-v-e8ae7d87>Return to top</button><!----></div></div><aside class="VPSidebar" data-v-324e8308 data-v-b04a928c><div class="curtain" data-v-b04a928c></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-b04a928c><span class="visually-hidden" id="sidebar-aria-label" data-v-b04a928c> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-b04a928c><section class="VPSidebarItem level-0 has-active" data-v-b04a928c data-v-c356ab37><div class="item" role="button" tabindex="0" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><h2 class="text" data-v-c356ab37>iztro开发文档</h2><!----></div><div class="items" data-v-c356ab37><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/quick-start.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>快速开始</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/type-definition.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>类型定义</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/posts/astrolabe.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>星盘</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/posts/palace.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>宫位</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/posts/star.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>星曜</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/posts/horoscope.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>运限</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/posts/config-n-plugin.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>配置和插件</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-b04a928c><section class="VPSidebarItem level-0" data-v-b04a928c data-v-c356ab37><div class="item" role="button" tabindex="0" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><h2 class="text" data-v-c356ab37>紫微斗数知识</h2><!----></div><div class="items" data-v-c356ab37><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/basis.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>基础扫盲</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/astrolabe.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>星盘介绍</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/palace.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>宫位知识</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" tabindex="0" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/star.html" data-v-c356ab37><!--[--><h3 class="text" data-v-c356ab37>星曜知识</h3><!--]--></a><!----></div><div class="items" data-v-c356ab37><!--[--><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/major-star.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>14主星</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/minor-star.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>14辅星</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/adj-star.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>37杂耀</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/dec-star.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>48神煞</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/mutagen.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>四化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/pattern.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>格局</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/horoscope.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>运限</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/setup.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>安星诀</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" tabindex="0" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/ancientBook.html" data-v-c356ab37><!--[--><h3 class="text" data-v-c356ab37>紫微斗数全书</h3><!--]--></a><!----></div><div class="items" data-v-c356ab37><!--[--><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/ancientBook-1.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>卷一</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/ancientBook-2.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>卷二</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/ancientBook-3.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>卷三</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-c356ab37 data-v-c356ab37><div class="item" data-v-c356ab37><div class="indicator" data-v-c356ab37></div><a class="VPLink link link" href="/learn/ancientBook-qa.html" data-v-c356ab37><!--[--><p class="text" data-v-c356ab37>诸星问答论</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-324e8308 data-v-3cf691b6><div class="VPDoc has-sidebar has-aside" data-v-3cf691b6 data-v-a3c25e27><!--[--><!--]--><div class="container" data-v-a3c25e27><div class="aside" data-v-a3c25e27><div class="aside-curtain" data-v-a3c25e27></div><div class="aside-container" data-v-a3c25e27><div class="aside-content" data-v-a3c25e27><div class="VPDocAside" data-v-a3c25e27 data-v-cb998dce><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-cb998dce data-v-c834746b><div class="content" data-v-c834746b><div class="outline-marker" data-v-c834746b></div><div class="outline-title" data-v-c834746b>页内导航</div><nav aria-labelledby="doc-outline-aria-label" data-v-c834746b><span class="visually-hidden" id="doc-outline-aria-label" data-v-c834746b> Table of Contents for current page </span><ul class="root" data-v-c834746b data-v-463da30f><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-cb998dce></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-a3c25e27><div class="content-container" data-v-a3c25e27><!--[--><!--]--><!----><main class="main" data-v-a3c25e27><div style="position:relative;" class="vp-doc _posts_palace" data-v-a3c25e27><div><h1 id="宫位" tabindex="-1">宫位 <a class="header-anchor" href="#宫位" aria-label="Permalink to &quot;宫位&quot;">​</a></h1><h2 id="前言" tabindex="-1">前言 <a class="header-anchor" href="#前言" aria-label="Permalink to &quot;前言&quot;">​</a></h2><p>紫微斗数中一共有 <code>十二</code> 个宫位，叫做 <code>十二人事宫</code>，囊括了与人有关的其他人和事物，这十二宫按顺序分别是 <code>命宫</code>、<code>兄弟宫</code>、<code>夫妻宫</code>、<code>子女宫</code>、<code>财帛宫</code>、<code>疾厄宫</code>、<code>迁移宫</code>、<code>仆役宫</code>、<code>官禄宫</code>、<code>田宅宫</code>、<code>福德宫</code>、<code>父母宫</code>。除了这展示在 <a href="./astrolabe.html">星盘</a> 里的十二宫以外，紫微斗数还有三个隐藏宫位，它们分别是 <code>身宫</code>、<code>来因宫</code>、<code>暗合宫</code>。每一个宫位有着它特殊的意义，但本页不详细展开来叙述。如果你对紫微斗数的宫位没有概念，或者想深入研究，可以点击 <a href="./../learn/palace.html">宫位系统</a> 查看详细资料。与宫位地支顺时针排列相反，宫位名称是按逆时针排列的。如下面表格所示：</p><table class="astrolabe"><tr><td>巳 <code>田宅</code></td><td>午 <code>官禄</code></td><td>未 <code>仆役</code></td><td>申 <code>迁移</code></td></tr><tr><td>辰 <code>福德</code></td><td class="center-palace" rowspan="2" colspan="2">中宫</td><td>酉 <code>疾厄</code></td></tr><tr><td>卯 <code>父母</code></td><td>戌 <code>财帛</code></td></tr><tr><td>寅 <code>命宫</code></td><td>丑 <code>兄弟</code></td><td>子 <code>夫妻</code></td><td>亥 <code>子女</code></td></tr></table><blockquote><p>以上表格只是一个例子，<code>命宫</code> 的位置会根据你的 <code>出生日期</code> 和 <code>出生时间</code> 的不同而不同，它可能出现在上述任何一个宫位，但这个顺序是不会变的。</p></blockquote><p>宫位其实是 <code>宫</code> 和 <code>位</code> 两个概念组成的，通过 <code>出生日期</code> 和 <code>出生时间</code> 计算出来的，叫 <code>宫</code>，所以你星盘中的 <code>财帛宫</code> 位置在本命盘中是固定的，如果你不知道什么叫 <code>本命盘</code>，我们强烈建议你点击 <a href="/learn/basis.html">基础知识扫盲</a> 学习。<code>位</code> 则是一个 <code>相对</code> 位置，比如 <code>夫妻宫</code> 的 <code>财帛位</code> 是 <code>迁移宫</code>。这听起来有些绕，好消息是，你不需要记忆这些烧脑的信息，只需要有这么一个概念就可以了。</p><h2 id="功能类定义" tabindex="-1">功能类定义 <a class="header-anchor" href="#功能类定义" aria-label="Permalink to &quot;功能类定义&quot;">​</a></h2><div class="warning custom-block"><p class="custom-block-title">开发建议</p><p>因为宫位是基于星盘而存在的，所以我们并不推荐你手动 <code>new</code> 一个宫位对象，而是使用星盘静态方法返回的对象使用。星盘的 <code>palaces</code> 属性包含了十二宫的数据，为了和地支的顺序保持一致，它是从 <code>寅宫</code> 开始按照地支顺序顺时针排列的。</p></div><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;font-style:italic;">import</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span><span style="color:#F07178;"> </span><span style="color:#A6ACCD;">astro</span><span style="color:#F07178;"> </span><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;font-style:italic;">from</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">iztro</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> astrolabe </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astro</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">astrolabeBySolarDate</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">2000-8-16</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">女</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#FF9CAC;">true</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">zh-CN</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>你可以有几种方式从上述 <code>astrolabe</code> 变量里获取到目标宫位，请根据实际需求使用：</p><ol><li><p>通过 <code>palaces</code> 的下标获取</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;">// 获取卯宫宫位</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#A6ACCD;">palaces[</span><span style="color:#F78C6C;">1</span><span style="color:#A6ACCD;">]</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>通过 <code>FunctionalAstrolabe</code> 类的 <code>palace()</code> 方法传入宫位 <code>索引</code> 获取</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;">// 获取卯宫宫位</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#F78C6C;">1</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>通过 <code>FunctionalAstrolabe</code> 类的 <code>palace()</code> 方法传入宫位 <code>名称</code> 获取</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;">// 获取命宫</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ol><h3 id="functionalpalace" tabindex="-1">FunctionalPalace <a class="header-anchor" href="#functionalpalace" aria-label="Permalink to &quot;FunctionalPalace&quot;">​</a></h3><hr><span class="VPBadge tip" data-v-7a7936a3><!--[-->implements<!--]--></span> <code>IFuncionalPalace</code> <span class="VPBadge tip" data-v-7a7936a3><!--[-->extends<!--]--></span> <a href="./../type-definition.html#palace"><code>Palace</code></a><p>该类所有属性都是继承自 <a href="./../type-definition.html#palace">Palace</a>，然后在接口内定义了一些方法用于对星曜进行分析。</p><ul><li><p>接口定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">interface</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">IFunctionalPalace</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">extends</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Palace</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">has</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notHave</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">hasOneOf</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">hasMutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">):</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notHaveMutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">):</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">isEmpty</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">excludeStars</span><span style="color:#89DDFF;">?:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">astrolabe</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">IFunctionalAstrolabe</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">undefined</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">fliesTo</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">fliesOneOfTo</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notFlyTo</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">selfMutaged</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">selfMutagedOneOf</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">?:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notSelfMutaged</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">?:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">mutagedPlaces</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> (</span><span style="color:#FFCB6B;">IFunctionalPalace</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">undefined</span><span style="color:#A6ACCD;">)[]</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div></li><li><p>属性</p><p>参考 <a href="./../type-definition.html#palace">Palace</a></p></li><li><p>方法</p><h4 id="has" tabindex="-1">has() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.0.0<!--]--></span> <a class="header-anchor" href="#has" aria-label="Permalink to &quot;has() &lt;Badge type=&quot;warning&quot; text=&quot;^1.0.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断某个宫位内是否有传入的 <code>星曜</code>，要 <code>所有</code> 星曜 <code>都在</code> 宫位内才会返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">has</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>stars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>true</code></td><td>-</td><td>星曜名称，可以包含主星、辅星、杂耀</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 是否有 <code>紫微星</code> 和 <code>右弼星</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">has</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">紫微</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">右弼</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">has</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">紫微</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">右弼</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="nothave" tabindex="-1">notHave() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.0.0<!--]--></span> <a class="header-anchor" href="#nothave" aria-label="Permalink to &quot;notHave() &lt;Badge type=&quot;warning&quot; text=&quot;^1.0.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断某个宫位内是否没有传入的 <code>星曜</code>，要所有星曜 <code>都不在</code> 宫位内才会返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notHave</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>stars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>true</code></td><td>-</td><td>星曜名称，可以包含主星、辅星、杂耀</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 是没有 <code>地空星</code> 和 <code>地劫星</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHave</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地空</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地劫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHave</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地空</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地劫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="hasoneof" tabindex="-1">hasOneOf() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.0.0<!--]--></span> <a class="header-anchor" href="#hasoneof" aria-label="Permalink to &quot;hasOneOf() &lt;Badge type=&quot;warning&quot; text=&quot;^1.0.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断某个宫位内是否有传入 <code>星曜</code> 的其中一个，只要 <code>命中一个</code> 就会返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">hasOneOf</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>stars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>true</code></td><td>-</td><td>星曜名称，可以包含主星、辅星、杂耀</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 是否有 <code>天魁星</code> 或 <code>天钺星</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">hasOneOf</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">天魁</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">天钺</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">hasOneOf</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">天魁</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">天钺</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="hasmutagen" tabindex="-1">hasMutagen() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.2.0<!--]--></span> <a class="header-anchor" href="#hasmutagen" aria-label="Permalink to &quot;hasMutagen() &lt;Badge type=&quot;warning&quot; text=&quot;^1.2.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位内是否有生年四化</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">hasMutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>mutagen</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a></td><td><code>true</code></td><td>-</td><td>四化名称【禄｜权｜科｜忌】</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 是否有 <code>化禄</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">hasMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">禄</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">hasMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">禄</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="nothavemutagen" tabindex="-1">notHaveMutagen() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.2.0<!--]--></span> <a class="header-anchor" href="#nothavemutagen" aria-label="Permalink to &quot;notHaveMutagen() &lt;Badge type=&quot;warning&quot; text=&quot;^1.2.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位内是否没有生年四化</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notHaveMutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>mutagen</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a></td><td><code>true</code></td><td>-</td><td>四化名称【禄｜权｜科｜忌】</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 是不是没有 <code>化忌</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHaveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">忌</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">palace</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHaveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">忌</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><h4 id="isempty" tabindex="-1">isEmpty() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.0.6<!--]--></span> <a class="header-anchor" href="#isempty" aria-label="Permalink to &quot;isEmpty() &lt;Badge type=&quot;warning&quot; text=&quot;^2.0.6&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断一个宫位是否为空宫（没有主星），有些派别在宫位内有某些星曜的情况下，是不会将该宫位判断为空宫的。所以加入一个参数来传入星曜。</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">isEmpty</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">excludeStars</span><span style="color:#89DDFF;">?:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>excludeStars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>false</code></td><td>-</td><td>星曜名称数组</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="astrolabe" tabindex="-1">astrolabe() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#astrolabe" aria-label="Permalink to &quot;astrolabe() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>获取当前宫位所在的星盘对象。</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">astrolabe</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">IFunctionalAstrolabe</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">undefined</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><p>无</p></li><li><p>返回值</p></li></ul><p><a href="./astrolabe.html#functionalastrolabe"><code>IFunctionalAstrolabe</code></a> | <code>undefined</code>;</p><h4 id="fliesto" tabindex="-1">fliesTo() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#fliesto" aria-label="Permalink to &quot;fliesTo() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断是否从源宫位飞化到目标宫位，四化可传入一个数组或者一个字符串，传入四化全部飞化到目标宫位即返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">fliesTo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>to</td><td><code>number</code> | <a href="./../type-definition.html#palacename"><code>PalaceName</code></a></td><td><code>true</code></td><td>-</td><td>目标宫位索引或名称</td></tr><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="fliesoneofto" tabindex="-1">fliesOneOfTo() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#fliesoneofto" aria-label="Permalink to &quot;fliesOneOfTo() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断是否从源宫位飞化其中一颗四化星到目标宫位，传入四化只要有一颗飞化到目标宫位即返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">fliesOneOfTo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>to</td><td><code>number</code> | <a href="./../type-definition.html#palacename"><code>PalaceName</code></a></td><td><code>true</code></td><td>-</td><td>目标宫位索引或名称</td></tr><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="notflyto" tabindex="-1">notFlyTo() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#notflyto" aria-label="Permalink to &quot;notFlyTo() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断是否没有从源宫位飞化到目标宫位，四化可传入一个数组或者一个字符串，传入四化全部没有飞化到目标宫位才返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notFlyTo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">to</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">number</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">PalaceName</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>to</td><td><code>number</code> | <a href="./../type-definition.html#palacename"><code>PalaceName</code></a></td><td><code>true</code></td><td>-</td><td>目标宫位索引或名称</td></tr><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="selfmutaged" tabindex="-1">selfMutaged() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#selfmutaged" aria-label="Permalink to &quot;selfMutaged() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位是否有自化，传入四化数组时需要全部满足才返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">selfMutaged</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="selfmutagedoneof" tabindex="-1">selfMutagedOneOf() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#selfmutagedoneof" aria-label="Permalink to &quot;selfMutagedOneOf() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位是否有自化，若不传入参数则会判断所有四化，满足一颗即返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">selfMutagedOneOf</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="notselfmutaged" tabindex="-1">notSelfMutaged() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#notselfmutaged" aria-label="Permalink to &quot;notSelfMutaged() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位是否有自化，如果传入参数，则只判断传入的四化是否有自化，否则将会判断所有四化</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notSelfMutaged</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> (</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#A6ACCD;font-style:italic;">withMutagens</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#A6ACCD;">[]</span></span>
<span class="line"><span style="color:#A6ACCD;">) </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>withMutagens</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a> |<a href="./../type-definition.html#mutagen"><code>Mutagen[]</code></a></td><td><code>true</code></td><td>-</td><td>四化（禄、权、科、忌）</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li></ul><h4 id="mutagedplaces" tabindex="-1">mutagedPlaces() <span class="VPBadge warning" data-v-7a7936a3><!--[-->^2.1.0<!--]--></span> <a class="header-anchor" href="#mutagedplaces" aria-label="Permalink to &quot;mutagedPlaces() &lt;Badge type=&quot;warning&quot; text=&quot;^2.1.0&quot; /&gt;&quot;">​</a></h4><ul><li><p>用途</p><p>获取当前宫位产生四化的4个宫位数组，下标分别对【禄，权，科，忌】</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">mutagedPlaces</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> (</span><span style="color:#FFCB6B;">IFunctionalPalace</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">undefined</span><span style="color:#A6ACCD;">)[]</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><p>无</p></li><li><p>返回值</p><p>(<a href="#functionalpalace"><code>IFunctionalPalace</code></a> | <code>undefined</code>)[]</p></li></ul></li></ul><h3 id="functionalsurpalaces" tabindex="-1">FunctionalSurpalaces <span class="VPBadge warning" data-v-7a7936a3><!--[-->^1.2.0<!--]--></span> <a class="header-anchor" href="#functionalsurpalaces" aria-label="Permalink to &quot;FunctionalSurpalaces &lt;Badge type=&quot;warning&quot; text=&quot;^1.2.0&quot; /&gt;&quot;">​</a></h3><hr><span class="VPBadge tip" data-v-7a7936a3><!--[-->implements<!--]--></span> <code>IFunctionalSurpalaces</code> <span class="VPBadge tip" data-v-7a7936a3><!--[-->extends<!--]--></span> <a href="./../type-definition.html#surroundedpalaces"><code>SurroundedPalaces</code></a><p>该类所有属性都是继承自 <a href="./../type-definition.html#surroundedpalaces">SurroundedPalaces</a>，然后在接口内定义了一些方法用于对星曜进行分析。</p><ul><li><p>接口定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">interface</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">FunctionalSurpalaces</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">extends</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">SurroundedPalaces</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">have</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notHave</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">haveOneOf</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">haveMutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#F07178;">notHaveMutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">):</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div></li><li><p>属性</p><p>参考 <a href="./../type-definition.html#surroundedpalaces">SurroundedPalaces</a></p></li><li><p>方法</p><h4 id="have" tabindex="-1">have() <a class="header-anchor" href="#have" aria-label="Permalink to &quot;have()&quot;">​</a></h4><ul><li><p>用途</p><p>判断某个宫三方四正内是否有传入的 <code>星曜</code>，要 <code>所有</code> 星曜 <code>都在</code> 三方四正内才会返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">have</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>stars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>true</code></td><td>-</td><td>星曜名称，可以包含主星、辅星、杂耀</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 三方四正是否有 <code>紫微星</code> 和 <code>右弼星</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palaces </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palaces</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">have</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">紫微</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">右弼</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">have</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">紫微</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">右弼</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="nothave-1" tabindex="-1">notHave() <a class="header-anchor" href="#nothave-1" aria-label="Permalink to &quot;notHave()&quot;">​</a></h4><ul><li><p>用途</p><p>判断某个宫三方四正内是否没有传入的 <code>星曜</code>，要所有星曜 <code>都不在</code> 三方四正内才会返回 <code>true</code></p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notHave</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">stars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">StarName</span><span style="color:#A6ACCD;">[]</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>stars</td><td><a href="./../type-definition.html#starname"><code>StarName[]</code></a></td><td><code>true</code></td><td>-</td><td>星曜名称，可以包含主星、辅星、杂耀</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 三方四正是否没有 <code>地空星</code> 和 <code>地劫星</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palaces </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palaces</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHave</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地空</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地劫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHave</span><span style="color:#A6ACCD;">([</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地空</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">地劫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">])</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="havemutagen" tabindex="-1">haveMutagen() <a class="header-anchor" href="#havemutagen" aria-label="Permalink to &quot;haveMutagen()&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位三方四正内是否有生年四化</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">haveMutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>mutagen</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a></td><td><code>true</code></td><td>-</td><td>四化名称【禄｜权｜科｜忌】</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 三方四正是否有 <code>化禄</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palaces </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palaces</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">haveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">禄</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">haveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">禄</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul><hr><h4 id="nothavemutagen-1" tabindex="-1">notHaveMutagen() <a class="header-anchor" href="#nothavemutagen-1" aria-label="Permalink to &quot;notHaveMutagen()&quot;">​</a></h4><ul><li><p>用途</p><p>判断宫位三方四正内是否没有生年四化</p></li><li><p>定义</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">type</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">notHaveMutagen</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">(</span><span style="color:#A6ACCD;font-style:italic;">mutagen</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">Mutagen</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">boolean</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li><li><p>参数</p><table><thead><tr><th>参数</th><th>类型</th><th>是否必填</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td>mutagen</td><td><a href="./../type-definition.html#mutagen"><code>Mutagen</code></a></td><td><code>true</code></td><td>-</td><td>四化名称【禄｜权｜科｜忌】</td></tr></tbody></table></li><li><p>返回值</p><p><code>boolean</code></p></li><li><p>示例</p><p>如果你想查看 <code>命宫</code> 三方四正是不是没有 <code>化忌</code></p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> palace </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> palace</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHaveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">忌</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><p>当然你也可以使用 <code>链式调用</code> 来简化代码</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> result </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> astrolabe</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">surroundedPalaces</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">命宫</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">notHaveMutagen</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">忌</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div></li></ul></li></ul></div></div></main><footer class="VPDocFooter" data-v-a3c25e27 data-v-5774f702><!--[--><!--]--><!----><nav class="prev-next" data-v-5774f702><div class="pager" data-v-5774f702><a class="pager-link prev" href="/posts/astrolabe.html" data-v-5774f702><span class="desc" data-v-5774f702>Previous page</span><span class="title" data-v-5774f702>星盘</span></a></div><div class="pager" data-v-5774f702><a class="pager-link next" href="/posts/star.html" data-v-5774f702><span class="desc" data-v-5774f702>Next page</span><span class="title" data-v-5774f702>星曜</span></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"readme.md\":\"09f566f2\",\"index.md\":\"f995e0c9\",\"learn_horoscope.md\":\"5bf234f4\",\"learn_basis.md\":\"1075e2b7\",\"en_us_index.md\":\"46461bd2\",\"learn_ancientbook-3.md\":\"500636b7\",\"en_us_about.md\":\"60cc2486\",\"en_us.md\":\"fa04505b\",\"learn_ancientbook-qa.md\":\"b8323f23\",\"learn_dec-star.md\":\"7427df6f\",\"learn_ancientbook-2.md\":\"9f2746a6\",\"learn_astrolabe.md\":\"01b7067e\",\"learn_ancientbook.md\":\"739e4513\",\"learn_adj-star.md\":\"5fa456ea\",\"learn_minor-star.md\":\"92eef434\",\"learn_ancientbook-1.md\":\"4435106c\",\"learn_mutagen.md\":\"d3464c28\",\"about.md\":\"8ed3a7d3\",\"learn_star.md\":\"9fff3a40\",\"learn_setup.md\":\"a4df5e55\",\"learn_palace.md\":\"4227379a\",\"learn_major-star.md\":\"ced91362\",\"learn_pattern.md\":\"fa1dbe8f\",\"posts_config-n-plugin.md\":\"dff7266a\",\"en_us_quick-start.md\":\"9102d6b4\",\"posts_horoscope.md\":\"9eec478f\",\"posts_star.md\":\"be6d8143\",\"posts_palace.md\":\"269d024b\",\"zh_tw_about.md\":\"8a6e7d56\",\"zh_tw_index.md\":\"a7aac7a8\",\"zh_tw_learn_adj-star.md\":\"2795970a\",\"posts_astrolabe.md\":\"863e27e2\",\"zh_tw_learn_ancientbook-1.md\":\"a475ba5f\",\"quick-start.md\":\"a2fcc083\",\"type-definition.md\":\"df892084\",\"zh_tw_learn_astrolabe.md\":\"4b3d8aff\",\"zh_tw_learn_ancientbook.md\":\"e72a790d\",\"zh_tw_learn_horoscope.md\":\"f9a26ad1\",\"zh_tw_learn_ancientbook-3.md\":\"616efbd6\",\"zh_tw_learn_basis.md\":\"fdf17830\",\"zh_tw_learn_ancientbook-2.md\":\"0199f753\",\"zh_tw_learn_ancientbook-qa.md\":\"28189ca7\",\"zh_tw_learn_dec-star.md\":\"69f70b70\",\"zh_tw_learn_minor-star.md\":\"f3d6de46\",\"zh_tw_learn_mutagen.md\":\"238cfae1\",\"zh_tw_learn_palace.md\":\"a77dfa43\",\"zh_tw_learn_setup.md\":\"3a4ece56\",\"zh_tw_learn_star.md\":\"29234dd5\",\"zh_tw_learn_pattern.md\":\"8591093a\",\"zh_tw_learn_major-star.md\":\"68e454a4\",\"zh_tw_posts_config-n-plugin.md\":\"d336009e\",\"zh_tw_posts_horoscope.md\":\"96a41ca8\",\"zh_tw_posts_star.md\":\"56f8b6d3\",\"zh_tw_posts_palace.md\":\"fd512bdd\",\"zh_tw_posts_astrolabe.md\":\"367606ff\",\"zh_tw_type-definition.md\":\"84c585d3\",\"zh_tw_quick-start.md\":\"40295961\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"紫微研习社 ziwei.pro\",\"description\":\"iztro is a lightweight Open-Source Javascript library of getting The Purple Star Astrology(Zi Wei Dou Shu) astrolabe information.\",\"base\":\"/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"search\":{\"provider\":\"local\"}},\"locales\":{\"root\":{\"label\":\"简体中文\",\"lang\":\"zh_CN\",\"themeConfig\":{\"nav\":[{\"text\":\"主页\",\"link\":\"/\"},{\"text\":\"开发\",\"link\":\"/quick-start.md\"},{\"text\":\"新手村\",\"link\":\"/learn/basis.md\"},{\"text\":\"排盘\",\"link\":\"https://ziwei.pub\"},{\"text\":\"讨论\",\"link\":\"https://github.com/SylarLong/iztro/discussions\"},{\"text\":\"关于作者\",\"link\":\"/about.md\"},{\"text\":\"<img src=\\\"https://img.shields.io/github/stars/sylarlong/iztro.svg?style=social&label=Star\\\" alt=\\\"iztro\\\" />\",\"link\":\"https://github.com/SylarLong/iztro\"},{\"text\":\"v2.4.1\",\"items\":[{\"text\":\"更改日志\",\"link\":\"https://github.com/SylarLong/iztro/blob/main/CHANGELOG.md\"},{\"text\":\"NPM地址\",\"link\":\"https://www.npmjs.com/package/iztro\"}]}],\"sidebar\":[{\"text\":\"iztro开发文档\",\"items\":[{\"text\":\"快速开始\",\"link\":\"/quick-start.md\"},{\"text\":\"类型定义\",\"link\":\"/type-definition.md\"},{\"text\":\"星盘\",\"link\":\"/posts/astrolabe.md\"},{\"text\":\"宫位\",\"link\":\"/posts/palace.md\"},{\"text\":\"星曜\",\"link\":\"/posts/star.md\"},{\"text\":\"运限\",\"link\":\"/posts/horoscope.md\"},{\"text\":\"配置和插件\",\"link\":\"/posts/config-n-plugin.md\"}]},{\"text\":\"紫微斗数知识\",\"items\":[{\"text\":\"基础扫盲\",\"link\":\"/learn/basis.md\"},{\"text\":\"星盘介绍\",\"link\":\"/learn/astrolabe.md\"},{\"text\":\"宫位知识\",\"link\":\"/learn/palace.md\"},{\"text\":\"星曜知识\",\"link\":\"/learn/star.md\",\"items\":[{\"text\":\"14主星\",\"link\":\"/learn/major-star.md\"},{\"text\":\"14辅星\",\"link\":\"/learn/minor-star.md\"},{\"text\":\"37杂耀\",\"link\":\"/learn/adj-star.md\"},{\"text\":\"48神煞\",\"link\":\"/learn/dec-star.md\"}]},{\"text\":\"四化\",\"link\":\"/learn/mutagen.md\"},{\"text\":\"格局\",\"link\":\"/learn/pattern.md\"},{\"text\":\"运限\",\"link\":\"/learn/horoscope.md\"},{\"text\":\"安星诀\",\"link\":\"/learn/setup.md\"},{\"text\":\"紫微斗数全书\",\"link\":\"/learn/ancientBook.md\",\"items\":[{\"text\":\"卷一\",\"link\":\"/learn/ancientBook-1.md\"},{\"text\":\"卷二\",\"link\":\"/learn/ancientBook-2.md\"},{\"text\":\"卷三\",\"link\":\"/learn/ancientBook-3.md\"}]},{\"text\":\"诸星问答论\",\"link\":\"/learn/ancientBook-qa.md\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/SylarLong/iztro\"}],\"outlineTitle\":\"页内导航\"}},\"zh_TW\":{\"label\":\"繁體中文\",\"lang\":\"zh_TW\",\"themeConfig\":{\"nav\":[{\"text\":\"主頁\",\"link\":\"/zh_TW/\"},{\"text\":\"開發\",\"link\":\"/zh_TW/quick-start.md\"},{\"text\":\"新手村\",\"link\":\"/zh_TW/learn/basis.md\"},{\"text\":\"排盤\",\"link\":\"https://ziwei.pub\"},{\"text\":\"討論\",\"link\":\"https://github.com/SylarLong/iztro/discussions\"},{\"text\":\"關於作者\",\"link\":\"/zh_TW/about.md\"},{\"text\":\"<img src=\\\"https://img.shields.io/github/stars/sylarlong/iztro.svg?style=social&label=Star\\\" alt=\\\"iztro\\\" />\",\"link\":\"https://github.com/SylarLong/iztro\"},{\"text\":\"v2.4.1\",\"items\":[{\"text\":\"更改日誌\",\"link\":\"https://github.com/SylarLong/iztro/blob/main/CHANGELOG.md\"},{\"text\":\"NPM地址\",\"link\":\"https://www.npmjs.com/package/iztro\"}]}],\"sidebar\":[{\"text\":\"iztro開發文檔\",\"items\":[{\"text\":\"快速開始\",\"link\":\"/zh_TW/quick-start.md\"},{\"text\":\"類型定義\",\"link\":\"/zh_TW/type-definition.md\"},{\"text\":\"星盤\",\"link\":\"/zh_TW/posts/astrolabe.md\"},{\"text\":\"宮位\",\"link\":\"/zh_TW/posts/palace.md\"},{\"text\":\"星曜\",\"link\":\"/zh_TW/posts/star.md\"},{\"text\":\"運限\",\"link\":\"/zh_TW/posts/horoscope.md\"},{\"text\":\"配置和插件\",\"link\":\"/zh_TW/posts/config-n-plugin.md\"}]},{\"text\":\"紫微鬥數知識\",\"items\":[{\"text\":\"基礎掃盲\",\"link\":\"/zh_TW/learn/basis.md\"},{\"text\":\"星盤介紹\",\"link\":\"/zh_TW/learn/astrolabe.md\"},{\"text\":\"宮位知識\",\"link\":\"/zh_TW/learn/palace.md\"},{\"text\":\"星曜知識\",\"link\":\"/zh_TW/learn/star.md\",\"items\":[{\"text\":\"14主星\",\"link\":\"/zh_TW/learn/major-star.md\"},{\"text\":\"14輔星\",\"link\":\"/zh_TW/learn/minor-star.md\"},{\"text\":\"37雜耀\",\"link\":\"/zh_TW/learn/adj-star.md\"},{\"text\":\"48神煞\",\"link\":\"/zh_TW/learn/dec-star.md\"}]},{\"text\":\"四化\",\"link\":\"/zh_TW/learn/mutagen.md\"},{\"text\":\"格局\",\"link\":\"/zh_TW/learn/pattern.md\"},{\"text\":\"運限\",\"link\":\"/zh_TW/learn/horoscope.md\"},{\"text\":\"安星訣\",\"link\":\"/zh_TW/learn/setup.md\"},{\"text\":\"紫微鬥數全書\",\"link\":\"/zh_TW/learn/ancientBook.md\",\"items\":[{\"text\":\"卷一\",\"link\":\"/zh_TW/learn/ancientBook-1.md\"},{\"text\":\"卷二\",\"link\":\"/zh_TW/learn/ancientBook-2.md\"},{\"text\":\"卷三\",\"link\":\"/zh_TW/learn/ancientBook-3.md\"}]},{\"text\":\"諸星問答論\",\"link\":\"/zh_TW/learn/ancientBook-qa.md\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/SylarLong/iztro\"}],\"outlineTitle\":\"頁內導航\"}},\"en_US\":{\"label\":\"English\",\"lang\":\"en_US\",\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/en_US/\"},{\"text\":\"Docs\",\"link\":\"/en_US/quick-start.md\"},{\"text\":\"Astrolabe\",\"link\":\"https://ziwei.pub\"},{\"text\":\"Discussions\",\"link\":\"https://github.com/SylarLong/iztro/discussions\"},{\"text\":\"<img src=\\\"https://img.shields.io/github/stars/sylarlong/iztro.svg?style=social&label=Star\\\" alt=\\\"iztro\\\" />\",\"link\":\"https://github.com/SylarLong/iztro\"},{\"text\":\"v2.4.1\",\"items\":[{\"text\":\"Changlog\",\"link\":\"https://github.com/SylarLong/iztro/blob/main/CHANGELOG.md\"},{\"text\":\"NPM Package\",\"link\":\"https://www.npmjs.com/package/iztro\"}]}],\"sidebar\":[{\"text\":\"iztro\",\"items\":[{\"text\":\"Quick Start\",\"link\":\"/en_US/quick-start.md\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/SylarLong/iztro\"}],\"outlineTitle\":\"Jump to\"}}},\"scrollOffset\":90,\"cleanUrls\":false}");</script>
    
  </body>
</html>